<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function reversalArr(arr){
            var newArr=[];
            for(i=0;i<arr.length;i++){
                newArr[newArr.length]=arr[arr.length-i-1];
            }
            return newArr;
        }
        var arr1=[];
         arr1.length=prompt(`请问您要输入几个数：`);
         for(i=0;i<arr1.length;i++){
            arr1[i]=prompt(`请输入第${i+1}个数：`);
         }
         console.log(arr1);
         console.log(reversalArr(arr1));
    </script>
</head>
<body>
    
</body>
</html>